/*
** ############################################################################
**     Project   : osdee - Operative Systems Design for Embedded Envrionments
**     File      : pll.h
**     Revision  ; 1.0
**     Abstract  :
**         PLL operation interface.
**     Processor : MC9S12XEP100CVL
**     Version   : Component 01.042, Driver 01.05, CPU db: 3.00.036
**     Datasheet : MC9S12XEP100 Rev. 1.19 12/2008
**
**     Copyright : 2014 Fernando Rodriguez, Open source with out any responsability.
**     
**     mail      : frr@gmail.com
** ############################################################################
*/

#ifndef _PLL_H_
#define _PLL_H_

#include "MCU_Cfg.h"
#include <MC9S12XEP100.h>
#include "pll_settings.h"
#include "cdef.h"

/*
** ===================================================================
**     Description :
**         Actual Bus frequency value.
** ===================================================================
*/
extern UINT32 mcal_mcu_u32BusFrequency;   

/*
** ===================================================================
**     Method      :  Mcu_vPLL_Init(void)
**
**     Description :
**         System clock and PLL initialization.
** ===================================================================
*/
void Mcu_vPLL_Init(void);

/*
** ===================================================================
**     Method      :  Mcu_vSelectClockSource_PLL(void)
**
**     Description :
**         Select PLL as clock source once it has been initialized.
** ===================================================================
*/
void Mcu_vSelectClockSource_PLL(void) ;

/*
** ===================================================================
**     Method      :  Mcu_vSelectClockSource_XTAL(void)
**
**     Description :
**         Select XTAL as clock source at any time.
** ===================================================================
*/
void Mcu_vSelectClockSource_XTAL(void);

/*
** ===================================================================
**     Method      :  Mcu_vPll_Clock_Monitor_Isr(void)
**
**     Description :
**         Clock Monitor Interrupt Service Routine.
** ===================================================================
*/
#pragma CODE_SEG __NEAR_SEG NON_BANKED
void Mcu_vPll_Clock_Monitor_Isr(void);
#pragma CODE_SEG DEFAULT

#endif /* _PLL_H_ */